package model;

import connection.DbConnection;
import bean.Poll;
import bean.PollUser;
import bean.Question;
import java.sql.*;


public class PMVotingImpl {
	
	/**
	 * Checks for the given username and password in the database
	 * 
	 * Returns: True if username and password correct, else false.
	 */
	public void openVoting(Question question) {
		try {
			System.out.println(question.getQuestionID()); // Error checking message
			DbConnection conn = new DbConnection();	
			conn.doUpdate("UPDATE QUESTION WHERE QUESTIONID='"+question.getQuestionID()+"'");
			System.out.println("Update done."); // Error checking message
		}
		catch (NullPointerException ne) {
			ne.printStackTrace();
			System.out.println("******** NOTICE: Consider looking over DbConnection and ensuring your");
			System.out.println("******** connection details are correct.");
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void createPoll (String username) {
		PollUser pu = new PollUser();
		pu.setAccessibility(3);
		
	}
}
